
<link href="<?php echo base_url()?>uploadify/uploadify.css" type="text/css" rel="stylesheet" />

<script type="text/javascript" src="<?php echo base_url()?>uploadify/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>uploadify/swfobject.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script src="<?php echo base_url()?>images/js/gmap.js"></script>

<script src="<?php echo base_url()?>images/js/qunit.js"></script>
<script src="<?php echo base_url()?>images/js/external/jquery.bgiframe-2.1.2.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.core.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.widget.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.mouse.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.button.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.draggable.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.position.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.resizable.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.ui.dialog.js"></script>
<script src="<?php echo base_url()?>images/js/ui/jquery.effects.core.js"></script>
<link rel="stylesheet" href="<?php echo base_url()?>images/js/themes/base/jquery.ui.all.css">
<link rel="stylesheet" href="<?php echo base_url()?>jqueryconfirm/jquery.confirm.css">

<style type="text/css">
    button.cupid-blue {
  background: #d7e5f5;
  background: -moz-linear-gradient(top, #9EDACE 0%, #9EDACE 100%);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#9EDACE), to(#9EDACE));
  border-top: 1px solid #abbbcc;
  border-left: 1px solid #a7b6c7;
  border-bottom: 1px solid #a1afbf;
  border-right: 1px solid #a7b6c7;
  -moz-border-radius: 12px;
  -webkit-border-radius: 100px;
  border-radius: 100px;
  -moz-box-shadow: inset 0 1px 0 0 #fff;
  -webkit-box-shadow: inset 0 1px 0 0 #fff;
  box-shadow: inset 0 1px 0 0 #fff;
  color: #464646;
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  font-size: 11px;
  font-weight: normal;
  line-height: 1;
  opacity:.85;

  text-align: center;
  text-shadow: 0 1px 1px #fff;
  width: 150px;
}

button.cupid-blue:hover {
  background: #ccd9e8;
  background: -moz-linear-gradient(top, #7CCCAB 0%, #7CCCAB 100%);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#AFEDE2), to(#AFEDE2));
  border-top: 1px solid #a1afbf;
  border-left: 1px solid #9caaba;
  border-bottom: 1px solid #96a3b3;
  border-right: 1px solid #9caaba;
  -moz-box-shadow: inset 0 1px 0 0 #f2f2f2;
  -webkit-box-shadow: inset 0 1px 0 0 #f2f2f2;
  box-shadow: inset 0 1px 0 0 #f2f2f2;
  color: #163659;
  cursor: pointer;
  

}

button.cupid-blue:active {
  border: 1px solid #8c98a7;
  -moz-box-shadow: inset 0 0 4px 2px #abbccf, 0 0 1px 0 #eee;
  -webkit-box-shadow: inset 0 0 4px 2px #abbccf, 0 0 1px 0 #eee;
  box-shadow: inset 0 0 4px 2px #abbccf, 0 0 1px 0 #eee;
}

    #mytable {
	width: 1240px;
	padding: 0;
	margin: 0;
}
#showAllSitDiv{
    padding-left:13px;
    padding-top:15px;
}

caption {
		padding: 0 0 .5em 0;
		text-align: left;
		font-size: 1.4em;
		font-weight: bold;
		text-transform: uppercase;
		color: white;
		background: transparent;
}

th {
	font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	color: #4f6b72;
	border-right: 1px solid #C1DAD7;
	border-bottom: 1px solid #C1DAD7;
	border-top: 1px solid #C1DAD7;
	letter-spacing: 2px;
	text-transform: uppercase;
	text-align: left;
	padding: 6px 6px 6px 12px;
	background: #CAE8EA url(<?php echo base_url()?>images/bg_header.jpg) no-repeat;
}

th.nobg {
	border-top: 0;
	border-left: 0;
	border-right: 1px solid #C1DAD7;
	background: none;
}

td {
	border-right: 1px solid #C1DAD7;
	border-bottom: 1px solid #C1DAD7;
	background: #fff;
	padding: 6px 6px 6px 12px;
	color: #4f6b72;
}


td.alt {
	background: #F5FAFA;
	color: #797268;
}

th.spec {
	border-left: 1px solid #C1DAD7;
	border-top: 0;
	background: #fff url(<?php echo base_url()?>images/bullet1.gif) no-repeat;
	font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}

th.specalt {
	border-left: 1px solid #C1DAD7;
	border-top: 0;
	background: #f5fafa url(<?php echo base_url()?>images/bullet2.gif) no-repeat;
	font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	color: #797268;
}
div.tapSelected
    {
		padding: 8px 4px 8px 4px;
		width:140px;
		float:left;
		text-align:center;
		margin: 0 0px;
		text-overflow:ellipsis;
		overflow:hidden;
		white-space:nowrap;
		background-color:white;
		color: #9edace;
		font-size:14px;
		font-family:cursive;
		-moz-border-radius-bottomright: 50px;
                border-top-right-radius: 10px;
                border-top-left-radius: 10px;



	}
    div.tap
	{
		padding: 8px 4px 8px 4px;
		width:140px;
		float:left;
		text-align:center;    
		margin: 0 0px;
		text-overflow:ellipsis;
		overflow:hidden;
		white-space:nowrap;
		/*background-color:#9edace;*/
		color: white;
		font-size:14px;
		font-family:cursive;
		border-left-width:1px;
		border-right-width:1px;
		border-left-style:solid;
		border-right-style:solid;
		border-left-color:rgba(158, 218, 206, 0);
		border-right-color:rgba(158, 218, 206, 0);
			

		
	}
	.ui-dialog-titlebar,.ui-dialog-buttonpane,.color
	{
		border-style:solid;border-width:1px;border-color:gray;-moz-border-radius:3px;border-radius:3px;background:rgba(0,0,0,0.21);font-size:14px;color:white;
	}
	.dialog_class
	{
		border-style:solid;border-width:1px;border-color:gray;-moz-border-radius:3px;border-radius:3px;background:rgba(0,0,0,0.61);font-size:14px;color:white;
	}
	
	
	#search_txt
	{
		height:25px;
		width: 220px;
		font-size: 12px;
		font-weight: normal;
		padding-left: 30px;
		outline: none;
		border: none;
		background: white;
		color: black;
		box-shadow: inset 1px 1px 3px #464646;
		-webkit-box-shadow: inset 1px 1px 3px #464646;
		-moz-box-shadow: inset 1px 1px 3px #464646;
	}
        .list_hover:hover
	{background:rgba(158, 218, 206,0.61); padding-left:3px; -moz-border-radius:3px;border-radius:3px;}
        .inputs{
                width:150px;
                font-size:13px
        }
        .iselect{
                width:160px;
                font-size:13px
        }


 .ui-draggable { cursor:move; }
#tip {
  position:absolute; display:none; height:25px; padding:9px 9px 0px;
  color:#fff; font-family:Verdana, Arial, Helvetica, sans-serif;
  font-size:11px; font-weight:bold; border-radius:4px;
  -moz-border-radius:4px; -webkit-border-radius:4px;
  background:#000; background:rgba(0,0,0,.5);
}

#tip .arrow {
  width:0; height:0; line-height:0; border-right:8px solid #000;
  border-right:8px solid rgba(0,0,0,.5); border-top:8px solid transparent;
  border-bottom:8px solid transparent; position:absolute; left:-8px;
  top:9px;
}

#targets {
  display:none; list-style-type:none; position:absolute; top:10px;
  z-index:99999;
}
#targets li{
  float:left; margin-right:20px; display:block; width:60px; height:60px;
  background:url(<?php echo base_url()?>images/png/socialMe/facebook_64.png) no-repeat 0 0; position:relative;
}
#targets li#delicious { background-position:0 -60px;

}
#targets li#facebook { background-position:0 -120px; }

#overlay {
  background-color:#000; position:absolute; top:0; left:0; width:100%;
  height:100%; z-index:99997;
}
#helper {
  background-color:#c2c2c2; position:absolute; height:35px;
  padding:15px 70px 0 20px; color:#fff;
  font-family:Verdana, Arial, Helvetica, sans-serif; font-weight:bold;
  font-size:18px; border-radius:8px; -moz-border-radius:8px;
  -webkit-border-radius:8px; border:3px solid #7d7d7d;
}
#thumb {
  width:50px; height:50px; position:absolute; right:0; top:0;
  border-left:3px solid #7d7d7d;
}
.share {
  font-weight:bold; position:absolute; font-size:14px;
  font-family:Verdana; margin-left:-38px;
}

</style>
</head>

<!-- this is for Mr.HELL use only -->
<ul id="targets">
<li id="facebook"><a href="http://www.facebook.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','www.facebook.com']);"><img src="<?php echo base_url()?>images/png/socialMe/facebook_64.png" id="share">Share on facebook<!-- --></a></li>
<li id="delicious"><a href="http://delicious.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','delicious.com']);"><img src="<?php echo base_url()?>images/png/socialMe/delicious_64.png"id="delicious " >Share on Delocious<!-- --></a></li>
<li id="twitter"><a href="http://twitter.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','twitter.com']);"><img src="<?php echo base_url()?>images/png/socialMe/twitter_64.png"id="share " >Sare on Twitter<!-- --></a></li>
</ul>


<script type="text/javascript">
    
    var cid=new Array();
    var cname=new Array();
 function sharing()
{
    window.location.href = "http://www.facebook.com/sharer.php?u=<?php echo base_url();?>view/publicView/" +selectedSitId+ "&t=" + document.getElementById(selectedSitId).innerText;
        /*var createTip = function(e){($("#tip").length === 0) ? $("<div>").html("<span>Drag this context to share it<\/span><span class='arrow'><\/span>").attr("id", "tip").css({ left:e.pageX + 30, top:e.pageY - 16 }).appendTo("body").fadeIn(2000).fadeOut(2000) : null;};
        for (var i = 0; i < cname.length; i++) {
        if(typeof(List_Contexts[i])  != "undefined")
        {
        $("#o_"+List_Contexts[i].name).bind("mouseenter", createTip);
        $("#o_"+List_Contexts[i].name).mousemove(function(e) {
        //move tooltip
        $("#tip").css({ left:e.pageX + 30, top:e.pageY - 16 });});
        $("#o_"+List_Contexts[i].name).mouseleave(function() {
        //alert(cid[i]);
                                         //remove tooltip
        $("#tip").remove();});
        // the dragable code here
        //make images draggable
        $("#o_"+List_Contexts[i].name).draggable({ // opacity: 0.7, helper: "clone",
              //create draggable helper
              helper: function() {
              return $("<div>").attr("id", "helper").html("<span>" + cname[i] + "</span><img id='thumb' src='" + $(this).attr("src") + "'>").appendTo("body"); },
              cursor: "pointer",
              cursorAt: { left: -10, top: 20 },
              zIndex: 99999,
              //show overlay and targets
              start: function() {
              $("<div>").attr("id", "overlay").css("opacity", 0.7).appendTo("body");
              $("#tip").remove();
              $(this).unbind("mouseenter");
              $("#targets").css("left", ($("body").width() / 2) - $("#targets").width() / 2).slideDown(); },
              //remove targets and overlay
              stop: function() {
                $("#targets").slideUp();
                $(".share", "#targets").remove();
                $("#overlay").remove();
                $(this).bind("mouseenter", createTip);
              }
        });
            /*var dduu=$("#targets li");
            $("#targets li").droppable({tolerance: "pointer",over: function() {$(".share", "#targets").remove();$("<span>").addClass("share").text("Share on " + $(this).attr("id")).addClass("active").appendTo($(this)).fadeIn();}
                ,drop: function() {
                var id = $(this).attr("id"),
                  currentUrl = window.location.href,
                    baseUrl = $(this).find("a").attr("href");
                if (id.indexOf("twitter") != -1) {
                  window.location.href = baseUrl + "/home?status=" + title + ": " + currentUrl;
                } else if (id.indexOf("delicious") != -1) {
                  window.location.href = baseUrl + "/save?url=" + currentUrl + "&title=" + title;
                } else if (id.indexOf("facebook") != -1) {
                  window.location.href = baseUrl + "/sharer.php?u=" + currentUrl + "&t=" + title;
                }
              }
            });
            }   //this is for the for loop
        }*/
}
</script>
<script type="text/javascript">
// THIS ISTHE SMART SEARCH VIEW HANDLING
//changing the picture to ok for searching.

    counter_im=0;
    tempDivHtml='';
    i=0;
    checkid='';
    listID=new Array();

    tags=new Array();
  function  smartsearch()
  {


    if(counter_im==0){

        tempDivHtml =document.getElementById('Div1').innerHTML;
        document.getElementById('smart_search').src="<?php echo base_url()?>images/ok.png";
        document.getElementById('smart_search').style.zIndex="2000";
        var i=0;
        list= List_Contexts;
        $("#overlayHeader").show();
        if(list!=null)
        {

        // this is to put checkbox in all contexts
            for(i=0;i<list.length;i++)
            {
                list[i].ID ='o_'+List_Contexts[i].name;
                document.getElementById(list[i].ID).innerHTML +="<input style='margin-right:auto;margin-left:auto;position: absolute; top:2px;right:5px;margin-top:3px; margin-bottom:0px;' type='checkbox' name='option1' id='box_"+list[i].ID+"' value='check' > " ;
            }
        }
        else
        {
            // insert the dialog that will error
        }
        i=0;
        counter_im++;
     }
        else if(counter_im==1)
        {
        document.getElementById('smart_search').src="<?php echo base_url()?>images/png/Site%20Map.png";
        document.getElementById('smart_search').style.zIndex="";
        $("#overlayHeader").hide();
        var cc=0;
        for(i=0;i<list.length;i++)
        {
            var checkid ='box_'+list[i].ID;
            var checked=document.getElementById(checkid).checked;
            if(checked==true)
            {
                tags+=list[i].tags;
            }
        }
        document.getElementById('Div1').innerHTML=tempDivHtml;
        counter_im=0;
        if(tags.length!=0){
            var tokens = tags.split(" ");

            for(var i = 0 ; i < tokens.length ; i++)
            {
                tokens[i] = "'" + tokens[i]+ "'" ;
            }
            var tokensString=tokens.join(",");
            var url='<?php echo base_url();?>searchengine/smartSearch';
            $("#waiting_div").show();
            $.post(url, {tags:tokensString},function(data) {

                $("#waiting_div").hide();
                document.getElementById('Div1').innerHTML=data;

            });
        }




  }
}




</script>

<!--view Friend script-->
<script type="text/javascript">
    function viewfriend()
    {
        var userEmail=username;
        var url='<?php echo base_url()?>userprofile/searchFriend';
        $("#waiting_div").show();
       $.post(url, {useremail:userEmail},function(data) {
      //  var nnnn = eval('(' +data + ')');
      //alert(data);
       $("#waiting_div").hide();
       
       
        document.getElementById('showAllSitDiv').innerHTML=data;
        document.getElementById('showAllSitDiv').innerHTML +='<img src="<?php echo base_url();?>images/download.png" onclick="hideAllSit()" style="position:absolute;height:40px;margin-right:30px;top:20;right:0px">';
        $("#showAllSitDiv").show();
       document.getElementById('showAllSitDiv').style.visibility="visible";
        //alert(nnnn);
  //  $.post(url, {tags:stringtags});         
              });
        
        
    }
    </script>
<!--header contents--->
	<div id="header_container"  style="pheight:62px;background-color:#464646;margin:-8px -8px 10px -8px;">
		<div style="">
			<div id="upper_header" style="background-color:rgba(70, 70, 70, 0.605469);height:27px;position:relative;margin:auto;width:100%">
				<p id="Home" style="margin-right:900px;margin-top:4px;margin-left:15px;float:left;font-size:17px;font-weight:bold;font-family: Arial, Helvetica, sans-serif;color:white;text-shadow: 0px 2px 1px #111;">Home</p>
				<input id="search_txt" type="search" placeholder="Press Enter.." onkeypress="searchKeyPress(event);" style="height:25px;position:absolute;margin:1px; -moz-border-radius:6px;border-radius:6px;box-shadow: inset 1px 1px 3px #1532;outline:none;border:none;" onmouseout="hide_search_option('search_options')":/>
                                <img alt=""  src="<?php echo base_url()?>images/images/search-icon.png"id="search_img" style="position:absolute;margin:5 0 0 8" />
                                <img src="<?php echo base_url()?>images/png/Site%20Map.png" title="Smart Search" id="smart_search" alt="Show all situation" onclick="smartsearch()" style="cursor:pointer;height:25px;position:absolute;margin:0 0 0 240"/>
				<img src="<?php echo base_url()?>images/png/Gear.png"  title="Settings" id="gear" alt="Show all situation" onclick="show_search_option('gear_options')" onmouseout="hide_search_option('gear_options')" style="cursor:pointer;height:25px;position:absolute;margin:0 0 0 270"/>
				<div id="search_options"style="padding-left:15px; background-color:white; width:150px; height:25px; z-index:3; float:right; position:absolute; margin-bottom:-100px; margin-left:960px;margin-top: 22px;border-style:solid;border-width:1px;border-color:gray;visibility:hidden;-moz-border-radius:3px;border-radius:3px;background:rgba(0,0,0,0.61)" onmouseover="show_search_option('search_options')" onmouseout="hide_search_option('search_options')">
				
				<ul style="list-style-type: none;padding: 0;margin: 0;font-size:12px;font-family:cursive;color:white;display:inline; ">
				<li style="display:inline">
				<input id="local" name="radio" checked type="radio"/> Local
				</li>
				<li style="display:inline">
				<input id="public" name="radio" type="radio"/> Public
				</li>
                                </ul>
				</div>	
				
				<div id="gear_options"style="padding-left:15px;padding-bottom:15px;padding-top:15px;padding-right:15px;visibility:hidden; background-color:white; width:150px; min-height:25px; z-index:3;  position:absolute; margin-bottom:-100px; margin-left:1075px;margin-top:22px;border-style:solid;border-width:1px;border-color:gray;-moz-border-radius:3px;border-radius:3px;background:rgba(0,0,0,0.61)" onmouseover="show_search_option('gear_options')" onmouseout="hide_search_option('gear_options')">

				<ul style="list-style-type: none;padding: 0;margin: 0;font-size:12px;font-family:cursive;color:white;display:inline; cursor:pointer; ">
				<li class="list_hover" onclick="enable_edit()" id="edit_gear">
					<a >  Edit </a>
				</li>
                                <li id="editsituation" class="list_hover" >
					<a >  Edit Situation Info.</a>
				</li>

                                <li id="del_sit" class="list_hover"  onclick="showcinf('Delete Situation','Are you Sure you Want To Delete ?','delete_situation()',true,'hideme()')">
					<a> Delete </a>
				</li>
                                <li onclick="sharing()" class="list_hover" id="share_gear">
					<a> Share  </a>
				</li>
				<li id="add_friend" class="list_hover" >
					<a> Add Friends </a>
				</li>
                                <li id="view_friend" class="list_hover" onclick="viewfriend()">
					<a> View Friends </a>
				</li>
                                <li id="export_sit" class="list_hover" >
					<a> Export </a>
				</li>
				<hr/>
				<li id="profile" class="list_hover">
					<a> Profile </a>
				</li>
                                <li onclick="javascript:setCookie('Situation','undefined',31);window.location='<?php echo base_url() ?>userprofile/logout'" class="list_hover" style="text-overflow:ellipsis;overflow:hidden;">
                                    <a id="logout"> Logout </a>
				</li>

				</ul>
				</div>
								
			</div>	
		<div id="overlayHeader" style="z-index: 1001; width: 100%; height: 65px;background-color:#999999;opacity: .3;top:0;position:absolute;display:none "></div>
		
		<div id="lower" style="background-color:rgba(158, 218, 206, 0.7) ; border-bottom-style:solid;border-bottom-color:white;border-bottom-width:3px;height:35px;position:relative;margin:auto;width:100%">
			
			<div id="left_control_div" style="height:35px;width:30px;position:absolute">
					<img src="<?php echo base_url()?>images/images/logo.png" id="logo" style="height:35px;position:absolute"/>
					<img src="<?php echo base_url()?>images/png/Expand Alt.png" title="Create new Situation" id="add" alt="previous situation" style="height:33px;position:absolute;margin:1 0 1 200;cursor:pointer;" />
					<img src="<?php echo base_url()?>images/png/Arrow Right 2.png" id="b" title="Scroll left" alt="previous situation" style="height:33px;position:absolute;margin:1 0 1 235;cursor:pointer;" />
					<div id="taps_container" style="height:35px;overflow:hidden; width:900px;margin:0 0 0 280;">
						<div id="tab_Menu" style="height:30px;width:8000px;position:relative">
						</div>
					</div>
					<img src="<?php echo base_url()?>images/png/Arrow Left 2.png" title="Scroll right" id="a" alt="next situation" style="height:33px;cursor:pointer;position:absolute;margin:-34 0 0 1184 "/>
                                        <img src="<?php echo base_url()?>images/png/Collapse Arrow Alt.png" title="Close situations lists" id="showAllSit" onclick="hideAllSit()"  style="visibility: hidden;height:33px;position:absolute;margin:-34 0 0 1219;cursor:pointer;"/>
                                        <img src="<?php echo base_url()?>images/png/closeAll.png"  id="all" title="My situations" onclick="getAll()"  alt="Show all situation" style="height:33px;position:absolute;margin:-34 0 0 1219;cursor:pointer;"/>
			</div>
			
			
			
			
		</div>
		
		</div>
	</div>
<script type="text/javascript">

     function getAll() {//don't forget to set onclick att in all img to getAll()
        var userEmail=username;
        $('#showAllSitDiv').show();
        document.getElementById('showAllSitDiv').style.visibility="visible";
        document.getElementById('showAllSit').style.visibility="visible";
        document.getElementById('all').style.visibility="hidden";

         var url='<?php echo base_url()?>home/getUserSituations';
         $("#waiting_div").show();
        $.post(url, {userEmail:userEmail},function(data) {
        $("#waiting_div").hide();
            var sitArray = eval('(' +data + ')');
        var sit_list=   '<table id="mytable" cellspacing="0" ><caption>Situations List</caption><tr><th scope="col" abbr="Configurations" >Situation Name</th><th scope="col" abbr="Dual 1.8GHz">Privacy Type</th><th scope="col" abbr="Dual 2GHz">no.Contexts</th><th scope="col" abbr="Dual 2.5GHz">Description</th></tr>';
        // var sit_list='<ul style="list-style-type:none">';
      var i;
      for(var i=0;i<sitArray.length;i++)
		{
                    var ids=sitArray[i].id;
                    ids=ids*10;
                    sit_list+="<tr><th id='"+ids+"' style='cursor:hand' onmouseover='changeTdClass("+ids+")'onmouseout='changeTdClassBack("+ids+")' onclick='hidDivAllLoadSit("+sitArray[i].id+")'  scope='row' class='spec'>"+sitArray[i].name+"</th><td>"+sitArray[i].privacyType+"</td><td>"+sitArray[i].contextNo+"</td><td>"+sitArray[i].description+"</td></tr>";
    //sit_list+="<li id='"+sitArray[i].id+"' class='tap' style='cursor:hand' onclick='hidDivAllLoadSit("+sitArray[i].id+")'  >"+sitArray[i].name+'--'+sitArray[i].privacyType+'--'+sitArray[i].description+'--'+sitArray[i].contextNo+"</li>";


		}
                sit_list+='<tfoot><tr> <th scope="row">Total</th><td colspan="4">'+i+'</td></tr></tfoot></table>';
                document.getElementById('showAllSitDiv').innerHTML=sit_list;





    });
     }
    function changeTdClassBack(id){
    document.getElementById(id).style.background="#f5fafa url(<?php echo base_url()?>images/bullet1.gif) no-repeat";
    }
    function changeTdClass(id){
     document.getElementById(id).style.background="url(<?php echo base_url()?>images/bg_header.jpg)";
    }
    function hideAllSit(){
        document.getElementById('showAllSit').style.visibility="hidden";
        document.getElementById('all').style.visibility="visible";
        $('#showAllSitDiv').hide();
        if(document.getElementById('suggestion').checked)
                                                location.reload(true);
     }
     function hidDivAllLoadSit(id){
         document.getElementById('Div1').style.resize='none';
         if(id!='undefined')
             loadhtml(id);
        for(var i=0;i<div_counter;i++)
        {
            var tap_id=document.getElementById('tab_Menu').getElementsByTagName('div')[i].id;
            if(tap_id==id)
            {
                var target=document.getElementById('tab_Menu').getElementsByTagName('div')[i].outerHTML;
                var first=document.getElementById('tab_Menu').getElementsByTagName('div')[counter].outerHTML;
                document.getElementById('tab_Menu').getElementsByTagName('div')[i].outerHTML=first;
                document.getElementById('tab_Menu').getElementsByTagName('div')[counter].outerHTML=target;
                //index++;
                break;

                //animation_counter++;

            }

        }

         document.getElementById('showAllSit').style.visibility="hidden";
        document.getElementById('all').style.visibility="visible";
        $('#showAllSitDiv').hide();

     }
</script>

<div id="showAllSitDiv" style="visibility:hidden;top:63px;left:1px;position: absolute;background:rgba(0,0,0,0.51);min-height:550px;width:1260px;z-index:500 "></div>



<!--start-->
<script type="text/javascript">
function getCookie(c_name)
{
    var i,x,y,ARRcookies=document.cookie.split(";");
    for (i=0;i<ARRcookies.length;i++)
      {
      x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
      y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
      x=x.replace(/^\s+|\s+$/g,"");
      if (x==c_name)
        {
        return unescape(y);
        }
      }
}

function setCookie(c_name,value,exdays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
    document.cookie=c_name + "=" + c_value;
}

function checkCookie()
{
    var situation_id=getCookie("Situation");
    if (situation_id!=null && situation_id!="")
      {
      //alert("Welcome again " + username);
      }
    else
      {
      //username=prompt("Please enter your name:","");
      if (username!=null && username!="")
        {
        setCookie("Situation",username,30);
        }
      }
}

</script>